from django.db import models

# Create your models here.
class Role(models.Model):
    rolename = models.CharField(max_length=20,null=False)

class User(models.Model):
    SEX = ((1,'男'),(2,'女'))
    uname = models.CharField(max_length=20,null=True)
    truename = models.CharField(max_length=20,null=False)
    pwd = models.CharField(max_length=32,null=False)
    tel = models.CharField(max_length=11)
    sex = models.IntegerField(choices=SEX,default=1)
    roleid = models.IntegerField(max_length=5,null=True)
    address = models.CharField(max_length=100)


# 用户类:
# 		id int 主键 自增
# uname varchar(20) not null
# truename varchar(20) not null
# pwd char(32) not null,
# tel char(11) not null
# sex int(1) not null--用户的性别：用1代表男 2代表女
# roleid int(5) not null  角色id
# address varchar(100) not null 地址
# 角色类型:
# 	id int 主键 自增
#     rolename varchar(20) not null